package com.db4o.odbgen.plugins.java.maingenerator.typedxmlschema;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * Contains the list of Java modifiers.
 * Use Modifier.getName() in order to obtain a value ready to be written in code.
 * @author liviug
 */
public enum TSModifier {
    ABSTRACT("abstract"),
    FINAL("final"), 
    NATIVE("native"), 
    PRIVATE("private"), 
    PROTECTED("protected"), 
    PUBLIC("public"), 
    STATIC("static"), 
    SYNCHRONIZED("synchronized"), 
    TRANSIENT("transient"), 
    VOLATILE("volatile"), 
    STRICTFP("strictfp");
    
    private String _name;
    TSModifier(String name){
        this._name = name;
    }
    
    /**
     * Returns the name of the modifier as it is found in the Java language.
     */
    public String getName() {
        return this._name;
    }

    /**
     * Convenient method that returns a private modifier.
     */
    public static List<TSModifier> getPrivateModifier() {
        List<TSModifier> res = new ArrayList<TSModifier>();
        res.add(TSModifier.PRIVATE);
        return res;
    }

    /**
     * Convenient method that returns a public modifier.
     */
    public static List<TSModifier> getPublicModifier() {
        List<TSModifier> res = new ArrayList<TSModifier>();
        res.add(TSModifier.PUBLIC);
        return res;
    }
    
    /**
     * Convenient method that returns a public static modifier.
     */
    public static List<TSModifier> getPublicStaticModifier() {
        List<TSModifier> res = new ArrayList<TSModifier>();
        res.add(TSModifier.PUBLIC);
        res.add(TSModifier.STATIC);
        return res;
    }

    /**
     * Convenient method that returns a private transient modifier.
     */
    public static List<TSModifier> getPrivateTransientModifier() {
        List<TSModifier> res = new ArrayList<TSModifier>();
        res.add(TSModifier.PRIVATE);
        res.add(TSModifier.TRANSIENT);
        return res;
    }
    
    /**
     * Convenient method that returns an empty modifier list.
     * This will make the field/class/interface/enum, internal.
     */
    public static List<TSModifier> getEmptyModifierList() {
        List<TSModifier> res = new ArrayList<TSModifier>();
        return res;
    }
}
